﻿@model IList<myMvcBlog.Models.PostView>
@foreach (var pv in Model)
{ 
    <div class="post">
        <h2>
            @Html.ActionLink(pv.Post.Name, "View", new { controller = "Post", nicename = pv.Post.UrlName })
        </h2>
        <small>@pv.Post.PostedTime.ToShortDateString()</small>
        <div class="entry">
            <p>
                @Html.Raw(pv.Post.Excerpt)
                @Html.ActionLink("阅读文章", "View", new { controller="Post", nicename = pv.Post.UrlName })
            </p>
        </div>
        <ul class="postmetadata">
            <li class="icon_comment icon_r">
                @Html.ActionLink(pv.Comments.Count() + " 条评论", "View", new { controller="Post", nicename = pv.Post.UrlName })
            </li>
            <li class="icon_cat"><strong>Category:</strong>
                @foreach (var category in pv.Categories)
                {
                    @Html.ActionLink(category.Name, "View", new
                   {
                       controller = "Category",
                       nicename = category.UrlName
                   });

                }
            </li>
            <li class="icon_tag"><strong>Tags:</strong>
                @foreach (var tag in pv.Tags)
                {
                    @Html.ActionLink(tag.Name + ", ", "View", new { controller = "Tag", nicename = tag.UrlName });
                }
            </li>
        </ul>
    </div>
}
